//
//  HMTextField.swift
//  Weibo
//
//  Created by 黄亦寒 on 16/9/19.
//  Copyright © 2016年 HM. All rights reserved.
//

import UIKit

//实时观察xib设置后的效果
@IBDesignable
class HMTextField: UITextField {

   //给xib提供设置属性
    //边框颜色
    @IBInspectable var borderColor:UIColor? {
        didSet {
            self.layer.borderColor = borderColor?.cgColor
        }
    }
    
    //边框宽度
    @IBInspectable var borderWidth:CGFloat = 0 {
        didSet {
            self.layer.borderWidth = borderWidth
        }
    }
    
    //边框弧度
    @IBInspectable var cornerRadius:CGFloat = 0 {
        didSet {
            self.layer.cornerRadius = cornerRadius
            self.layer.masksToBounds = true
        }
    }

}
